//
//  ChatMoreView.m
//  BGM
//
//  Created by 我要变好看 on 2019/1/15.
//  Copyright © 2019 com.alirtc.demo. All rights reserved.
//

#import "ChatMoreView.h"
#import "Common.h"
#import "PushCollectionViewCell.h"

@interface ChatMoreView ()<PushCollectionViewCellDelegate>

@end
@implementation ChatMoreView


-(instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self != nil) {
        self.backgroundColor = [UIColor whiteColor];
        NSArray *textArray = @[@{@"text":@"照片",@"image":@"",@"key":@"1"},@{@"text":@"拍照",@"image":@"",@"key":@"2"},@{@"text":@"语音通话",@"image":@"",@"key":@"3"},@{@"text":@"视频通话",@"image":@"",@"key":@"4"}];

        for (int i = 0;  i < 2; i++) {
            int x = i%4;
            int y = i/4;
            PushCollectionViewCell *cell = [[PushCollectionViewCell alloc]initWithFrame:CGRectMake(x*(SCREENW/4),y, SCREENW/4, SCREENW/4+20)];
            NSDictionary *dic = [textArray objectAtIndex:i];
            cell.dic = dic;
            [cell.iconBtn setImage:[UIImage imageNamed:[NSString stringWithFormat:@"chatmore%d",i]] forState:UIControlStateNormal];
            cell.pushCellDelegate = self;
//            cell.iconTitle.text = [NSString stringWithFormat:@"%@",[dic objectForKey:@"text"]];
            [self addSubview:cell];
        }
    }
    return self;
}

- (void)clickCell:(NSDictionary *)dic{
    int i = [[NSString stringWithFormat:@"%@",[dic objectForKey:@"key"]]intValue];
    [self.moreDelegate clickMoreBtn:i];
}

@end
